<template>
	<view class="zone">
		<Header title="修仙游戏"></Header>
		<view class="main">
			<image class="yun" src="http://image.qxgm.site/tdz/img/public/m_yun.png" mode="widthFix"></image>
			<image class="ping1" src="http://image.qxgm.site/tdz/img/public/ping1.png" mode="widthFix"></image>
			<view class="box">

				<image @click="$p.navto('/pages/index/wolfkill')" src="http://image.qxgm.site/tdz/img/active/a1.png"
					mode="widthFix"></image>
				<image @click="$p.navto('/pages/index/ImmorArtloot')" src="http://image.qxgm.site/tdz/img/active/a2.png"
					mode="widthFix"></image>
				<image src="http://image.qxgm.site/tdz/img/active/a3.png" mode="widthFix" @click="xixi"></image>
				<image src="http://image.qxgm.site/tdz/img/active/a4.png" mode="widthFix" @click="xixi"></image>
				<image src="http://image.qxgm.site/tdz/img/active/a5.png" mode="widthFix" @click="xixi"></image>
				<image src="http://image.qxgm.site/tdz/img/active/a6.png" mode="widthFix" @click="xixi"></image>

			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				name: '',
				ali_account: '',
				act: false
			}
		},
		onLoad() {

		},
		onShow() {
			this.getUserInfo()
		},
		methods: {
			// 获取信息
			async getUserInfo() {
				let res = await this.$http.index.getUserInfo()
				this.name = res.data.alipay_name
				this.ali_account = res.data.alipay_account
				if (this.name == '' || this.name == null) {
					this.act = false
				} else {
					this.act = true
				}
			},
			// 提交
			async submits() {
				if (this.name == '' || this.name == null) {
					this.$u.toast('收款人姓名不能为空')
				} else if (this.ali_account == '' || this.ali_account == null) {
					this.$u.toast('支付宝账号不能为空')
				} else if (!/(^1[3-9]\d{9}$)|(^[\w\d-]+(\.[\w\d-]+)*@[\w\d-]+(\.[\w\d-]+)+$)/.test(this.ali_account)) {
					this.$u.toast('支付宝账号不合法');
				} else if (!!this.act) {
					this.$u.toast('已绑定');
				} else {
					let res = await this.$http.index.bindAli({
						name: this.name,
						ali_account: this.ali_account
					})
					this.$u.toast(res.msg)
					if (res.code == 1) {
						this.getUserInfo()
					}
				}
			},
            xixi(){
                this.$u.toast('敬请期待!');
            },
		}
	}
</script>

<style lang="less">
	.zone {
		min-height: 100vh;
		background: url(http://image.qxgm.site/tdz/img/public/p_bg.png) no-repeat;
		background-size: 100% auto;
	}

	.main {
		width: 100%;
		position: relative;
		margin-top: 10px;
	}

	.yun {
		position: absolute;
		top: -3%;
		left: 0;
		width: 44%;
		z-index: 9;
	}

	.box {
		height: calc(100vh - 97px);
		overflow-y: scroll;
		background: url(http://image.qxgm.site/tdz/img/public/ping2.png);
		background-size: 100% auto;
		padding: 10px 13px 0;
		border-bottom: 6px solid #b0a3a1;

		image {
			width: 100%;
		}
	}

	.ping1 {
		width: 100%;
		display: flex;
	}
</style>